﻿using System.Collections.Generic;

using Web.Library.Enum;

namespace Web.Library.Interface
{
    /// <summary>
    /// A contract to all classes in Repositories
    /// </summary>
    /// <typeparam name="T"></typeparam>
    /// <typeparam name="K"></typeparam>
    public interface IRepository<T, K>
    {
        bool Save(T domain);
        bool Update(T domain);
        bool Delete(K key);
        List<T> GetList();
        List<T> GetList(int pageSize, int currentPage, string sortName, string sortOrder);
        T GetById(K key);
        object SelectScalar(SQL.Function.Aggregate function, string column);

    }
    public interface IVRepository<T, K>
    {
        List<T> GetList();
        List<T> GetList(int pageSize, int currentPage, string sortName, string sortOrder);
        T GetById(K key);
        object SelectScalar(SQL.Function.Aggregate function, string column);

        string GetErrorMessage();
    }
}
